// 组合继承
function SuperType(name) {
  this.name = name;
  this.colors = ['red', 'blue', 'green'];
}

SuperType.prototype.sayName = function() {
  console.log(this.name);
}

function SubType(name,age) {
  // this指向实例对象
  SuperType.call(this, name);
  this.age = age;
}
SubType.prototype = new SuperType(); 
SubType.prototype.sayAge = function() {
  console.log(this.age);
}

let instance = new SubType('wzy',29);
console.log(instance);
console.log(SubType.prototype);
